package com.qiaofang.applet.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @Author: youqing.yang
 * @Create: 2020/10/23 15:52
 * @Description:
 **/
@Getter
@AllArgsConstructor
public enum MySignStatusEnum {
    DRAFT("DRAFT", "草稿"),
    RECALLED("RECALLED", "已撤回"),
    SIGNING("SIGNING", "签署中"),
    REJECTED("REJECTED", "拒绝签约"),
    SIGNED("SIGNED", "已签约"),
    EXPIRED("EXPIRED", "已过期"),
    FILLING("FILLING", "拟定中"),
    WAITING("WAITING", "待签约"),
    INVALIDING("INVALIDING", "作废中"),
    INVALIDED("INVALIDED", "已作废"),
    WAITING_START("WAITING_START","待发起签署");
    private String code;

    private String value;


    public static String getValueByCode(String code) {
        if (StringUtils.isEmpty(code)) {
            return null;
        }
        for (MySignStatusEnum item : values()) {
            if (StringUtils.equals(item.getCode(), code)) {
                return item.getValue();
            }
        }
        return null;
    }

}
